use crate::{event_info, function::input::KeyCode};

use super::event_type::{Event, EventCategory, EventType, StaticEvent};


event_info! {
    pub struct KeyPressedEvent {
        handle:bool,
        code:  KeyCode
    },
    EventType::KeyPressed,
    EventCategory::EventCategoryKeyboard
}

impl KeyPressedEvent {
    pub fn new(code:KeyCode) -> Self {
        Self { handle: false, code }
    }

    pub fn get_code(&self) -> KeyCode {
        self.code
    }
}



event_info! {
    pub struct KeyReleasedEvent {
        handle:bool,
        code:  KeyCode
    },
    EventType::KeyReleased,
    EventCategory::EventCategoryKeyboard
}

impl KeyReleasedEvent {
    pub fn new(code:KeyCode) -> Self {
        Self { handle: false, code }
    }

    pub fn get_code(&self) -> KeyCode {
        self.code
    }
}



event_info! {
    pub struct KeyTypeEvent {
        handle:bool,
        code:  KeyCode
    },
    EventType::KeyReleased,
    EventCategory::EventCategoryKeyboard
}


